#include "modes.h"
#include "sm4.h"

void sm4_cbc_encrypt(const unsigned char* in, unsigned char* out, size_t len,
                     const sm4_key_t* key, unsigned char* iv, int enc)
{
    if (enc)
        CRYPTO_cbc128_encrypt(in, out, len, key, iv, (block128_f)sm4_encrypt);
    else
        CRYPTO_cbc128_decrypt(in, out, len, key, iv, (block128_f)sm4_encrypt);
}
